<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Pragma" content="no-cache"> 
	<meta http-equiv="Cache-Control" content="no-cache"> 
	<meta http-equiv="Expires" content="0"> 
	<title>PCI1714</title>
	<link rel="stylesheet" type="text/css" href="../js/easyui/themes/bootstrap/easyui.css">
	<link rel="stylesheet" type="text/css" href="../js/easyui/themes/icon.css">
	<script type="text/javascript" src="../js/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="../js/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../js/extEasyUI.js?v=201305241044" charset="utf-8"></script>
	<script type="text/javascript" src="../js/extJquery.js?v=201305301341" charset="utf-8"></script>

	
	<script type="text/javascript">
	
		var intv;

		$(function() {
			
			load();
			
			loadState();
			
			intv = setInterval(loadState, 5000);
			
		});
		
	
		function save(){
			
			$.messager.progress();
			
			$('#ftype').form('submit', {
				url:'../pci1714/setPciConfig.do',
				success: function(){
					$.messager.progress('close');	// hide progress bar while submit successfully
				}
			});
			
		}
		
		function load(){
			
			$.messager.progress();
			$('#ftype').form('load', '../pci1714/getPciConfig.do');
			$.messager.progress('close');
			
		}
		
		function loadState() {
			
			$.ajax({ 
		        type: "post", 
                url: '../pci1714/getPciState.do',
                dataType: "json",
                success: function (data) {
                	$('#state').val(data.state);
                	$('#status').val(data.status);
                },
                error: function () {
                	$('#state').val("UNKNOWN, Refresh error.");
                	$('#status').val("UNKNOWN, Refresh error.");
                }
			});
			
		}
		
	</script>
	
	
</head>
<body>

	<div style="margin:10px 0;"></div>
	
	<div class="easyui-panel" title="配置信息" style="width:600px">
	
		<div style="padding:10px 60px 20px 60px">

		    <form id="ftype" method="post">
		    	<table>
		    		<tr>
		    			<td>设备序号:</td>
		    			<td>
		    				<input name="deviceIndex" type="text" value="">
						</td>
		    		</tr>
		    		<tr>
		    			<td>采样频率:</td>
		    			<td>
		    				<input name="samplingFrequency" type="text" value="">
						</td>
						<td>Hz</td>
		    		</tr>		    		
		    		<tr>
		    			<td>起始通道:</td>
		    			<td>
		    				<input name="channelStart" type="text" value="">
						</td>
		    		</tr>		    		
		    		<tr>
		    			<td>取值范围:</td>
		    			<td>
		    				<select name="valueRange" class="easyui-combobox">
		    				    <option value="V_Neg5To5">+/- 5V</option>
							    <option value="V_Neg2pt5To2pt5">+/- 2.5V</option>
							    <option value="V_Neg1To1">+/- 1V</option>
							    <option value="mV_Neg500To500">+/- 500mV</option>
							</select>
						</td>
		    		</tr>		    						    		
		    	</table>
		    </form>
	    
	    </div>
	    
	    <div style="padding:10px 60px 10px 60px">
		
			<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" style="width:80px" onclick="save()">应用</a>
			<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-no'" style="width:80px" onclick="load()">刷新</a>
			
		</div>	
	    
	</div>	
	
	<div class="easyui-panel" title="运行状态" style="width:600px">
		
		<div style="margin:10px 10px;">
		
		<p>运行状态：</p>
		
		<input id="state" type="text" value="" disabled="disabled" style="width:100%">
		
		</div>
		
		<div style="margin:10px 10px;">
		
		<p>状态描述：</p>
		
		<input id="status" type="text" value="" disabled="disabled" style="width:100%">
			    
		</div>
		
		<div style="padding:10px 60px 10px 60px">
		
			<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-no'" style="width:80px" onclick="loadState()">刷新</a>
			
		</div>
		
	</div>	


</body>
</html>